#!/usr/bin/env python
# coding=utf-8
import pretty_errors
import re

# 3.3 正则表达式
# 2.match
content = 'Hello 123 4567 World_This is a Regex Demo'
print(len(content))
result = re.match('^Hello\s\d\d\d\s\d{4}\s\w{10}', content)
print(result)
print(result.group())
print(result.span())

# 匹配目标
content = 'Hello 1234567 World_This is a Regex Demo'
result = re.match('^Hello\s(\d+)\sWorld', content)
print('\n 匹配目标')
print(result)
print(result.group())
print(result.group(1))
print(result.span())

# 通用匹配
content = 'Hello 123 4567 World_This is a Regex Demo'
result = re.match('^Hello.*Demo$', content)
print('\n 通用匹配')
print(result)
print(result.group())
print(result.span())

#p143...
